home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2001 May / SGI Freeware 2001 May - Disc 1.iso / dist / fw_qt.idb / usr / freeware / include / qxml.h.z / qxml.h
C/C++ Source or Header  |  2001-04-12  |  19KB  |  665 lines

  1. /****************************************************************************
  2. ** $Id: qt/src/xml/qxml.h   2.3.0   edited 2001-01-26 $
  3. **
  4. ** Definition of QXmlSimpleReader and related classes.
  5. **
  6. ** Created : 000518
  7. **
  8. ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
  9. **
  10. ** This file is part of the XML module of the Qt GUI Toolkit.
  11. **
  12. ** This file may be distributed under the terms of the Q Public License
  13. ** as defined by Trolltech AS of Norway and appearing in the file
  14. ** LICENSE.QPL included in the packaging of this file.
  15. **
  16. ** This file may be distributed and/or modified under the terms of the
  17. ** GNU General Public License version 2 as published by the Free Software
  18. ** Foundation and appearing in the file LICENSE.GPL included in the
  19. ** packaging of this file.
  20. **
  21. ** Licensees holding valid Qt Enterprise Edition licenses may use this
  22. ** file in accordance with the Qt Commercial License Agreement provided
  23. ** with the Software.
  24. **
  25. ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  26. ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  27. **
  28. ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
  29. **   information about Qt Commercial License Agreements.
  30. ** See http://www.trolltech.com/qpl/ for QPL licensing information.
  31. ** See http://www.trolltech.com/gpl/ for GPL licensing information.
  32. **
  33. ** Contact info@trolltech.com if any conditions of this licensing are
  34. ** not clear to you.
  35. **
  36. **********************************************************************/
  37.  
  38. #ifndef QXML_H
  39. #define QXML_H
  40.  
  41. #include <qmodules.h>
  42.  
  43. #if !defined(QT_MODULE_XML)
  44. #define QM_EXPORT
  45. #else
  46. #define QM_EXPORT Q_EXPORT
  47. #endif
  48.  
  49. #ifndef QT_H
  50. #include <qtextstream.h>
  51. #include <qfile.h>
  52. #include <qstring.h>
  53. #include <qstringlist.h>
  54. #include <qvaluestack.h>
  55. #include <qmap.h>
  56. #endif // QT_H
  57.  
  58. #ifndef QT_NO_XML
  59.  
  60. class QXmlNamespaceSupport;
  61. class QXmlAttributes;
  62. class QXmlContentHandler;
  63. class QXmlDefaultHandler;
  64. class QXmlDTDHandler;
  65. class QXmlEntityResolver;
  66. class QXmlErrorHandler;
  67. class QXmlLexicalHandler;
  68. class QXmlDeclHandler;
  69. class QXmlInputSource;
  70. class QXmlLocator;
  71. class QXmlNamespaceSupport;
  72. class QXmlParseException;
  73.  
  74. class QXmlReader;
  75. class QXmlSimpleReader;
  76.  
  77. class QXmlSimpleReaderPrivate;
  78. class QXmlNamespaceSupportPrivate;
  79. class QXmlAttributesPrivate;
  80. class QXmlInputSourcePrivate;
  81. class QXmlParseExceptionPrivate;
  82. class QXmlLocatorPrivate;
  83. class QXmlDefaultHandlerPrivate;
  84.  
  85.  
  86. //
  87. // SAX Namespace Support
  88. //
  89.  
  90. #if defined(Q_TEMPLATEDLL)
  91. // MOC_SKIP_BEGIN
  92. template class QM_EXPORT QMap<QString, QString>;
  93. template class QM_EXPORT QValueStack<QMap<QString, QString> >;
  94. template class QM_EXPORT QValueStack<QString>;
  95. // MOC_SKIP_END
  96. #endif
  97.  
  98. class QM_EXPORT QXmlNamespaceSupport
  99. {
  100. public:
  101.     QXmlNamespaceSupport();
  102.     ~QXmlNamespaceSupport();
  103.  
  104.     void setPrefix( const QString&, const QString& );
  105.  
  106.     QString prefix( const QString& ) const;
  107.     QString uri( const QString& ) const;
  108.     void splitName( const QString&, QString&, QString& ) const;
  109.     void processName( const QString&, bool, QString&, QString& ) const;
  110.     QStringList prefixes() const;
  111.     QStringList prefixes( const QString& ) const;
  112.  
  113.     void pushContext();
  114.     void popContext();
  115.     void reset();
  116. private:
  117.     QValueStack<QMap<QString, QString> > nsStack;
  118.     QMap<QString, QString> ns;
  119.  
  120.     QXmlNamespaceSupportPrivate *d;
  121. };
  122.  
  123.  
  124. //
  125. // SAX Attributes
  126. //
  127.  
  128. class QM_EXPORT QXmlAttributes
  129. {
  130. public:
  131.     QXmlAttributes() {}
  132.     virtual ~QXmlAttributes() {}
  133.  
  134.     int index( const QString& qName ) const;
  135.     int index( const QString& uri, const QString& localPart ) const;
  136.     int length() const;
  137.     QString localName( int index ) const;
  138.     QString qName( int index ) const;
  139.     QString uri( int index ) const;
  140.     QString type( int index ) const;
  141.     QString type( const QString& qName ) const;
  142.     QString type( const QString& uri, const QString& localName ) const;
  143.     QString value( int index ) const;
  144.     QString value( const QString& qName ) const;
  145.     QString value( const QString& uri, const QString& localName ) const;
  146.  
  147. private:
  148.     QStringList qnameList;
  149.     QStringList uriList;
  150.     QStringList localnameList;
  151.     QStringList valueList;
  152.  
  153.     QXmlAttributesPrivate *d;
  154.  
  155.     friend class QXmlSimpleReader;
  156. };
  157.  
  158. //
  159. // SAX Input Source
  160. //
  161.  
  162. class QM_EXPORT QXmlInputSource
  163. {
  164. public:
  165.     QXmlInputSource();
  166.     QXmlInputSource( QTextStream& stream );
  167.     QXmlInputSource( QFile& file );
  168.     virtual ~QXmlInputSource();
  169.  
  170.     virtual const QString& data() const;
  171.     virtual void setData( const QString& d );
  172.  
  173. private:
  174.     void readInput( QByteArray& rawData );
  175.  
  176.     QString input;
  177.  
  178.     QXmlInputSourcePrivate *d;
  179. };
  180.  
  181. //
  182. // SAX Exception Classes
  183. //
  184.  
  185. class QM_EXPORT QXmlParseException
  186. {
  187. public:
  188.     QXmlParseException( const QString& name="", int c=-1, int l=-1, const QString& p="", const QString& s="" )
  189.     : msg( name ), column( c ), line( l ), pub( p ), sys( s )
  190.     { }
  191.  
  192.     int columnNumber() const;
  193.     int lineNumber() const;
  194.     QString publicId() const;
  195.     QString systemId() const;
  196.     QString message() const;
  197.  
  198. private:
  199.     QString msg;
  200.     int column;
  201.     int line;
  202.     QString pub;
  203.     QString sys;
  204.  
  205.     QXmlParseExceptionPrivate *d;
  206. };
  207.  
  208.  
  209. //
  210. // XML Reader
  211. //
  212.  
  213. class QM_EXPORT QXmlReader
  214. {
  215. public:
  216.     virtual bool feature( const QString& name, bool *ok = 0 ) const = 0;
  217.     virtual void setFeature( const QString& name, bool value ) = 0;
  218.     virtual bool hasFeature( const QString& name ) const = 0;
  219.     virtual void* property( const QString& name, bool *ok = 0 ) const = 0;
  220.     virtual void setProperty( const QString& name, void* value ) = 0;
  221.     virtual bool hasProperty( const QString& name ) const = 0;
  222.     virtual void setEntityResolver( QXmlEntityResolver* handler ) = 0;
  223.     virtual QXmlEntityResolver* entityResolver() const = 0;
  224.     virtual void setDTDHandler( QXmlDTDHandler* handler ) = 0;
  225.     virtual QXmlDTDHandler* DTDHandler() const = 0;
  226.     virtual void setContentHandler( QXmlContentHandler* handler ) = 0;
  227.     virtual QXmlContentHandler* contentHandler() const = 0;
  228.     virtual void setErrorHandler( QXmlErrorHandler* handler ) = 0;
  229.     virtual QXmlErrorHandler* errorHandler() const = 0;
  230.     virtual void setLexicalHandler( QXmlLexicalHandler* handler ) = 0;
  231.     virtual QXmlLexicalHandler* lexicalHandler() const = 0;
  232.     virtual void setDeclHandler( QXmlDeclHandler* handler ) = 0;
  233.     virtual QXmlDeclHandler* declHandler() const = 0;
  234.     virtual bool parse( const QXmlInputSource& input ) = 0;
  235. };
  236.  
  237. class QM_EXPORT QXmlSimpleReader : public QXmlReader
  238. {
  239. public:
  240.     QXmlSimpleReader();
  241.     virtual ~QXmlSimpleReader();
  242.  
  243.     bool feature( const QString& name, bool *ok = 0 ) const;
  244.     void setFeature( const QString& name, bool value );
  245.     bool hasFeature( const QString& name ) const;
  246.  
  247.     void* property( const QString& name, bool *ok = 0 ) const;
  248.     void setProperty( const QString& name, void* value );
  249.     bool hasProperty( const QString& name ) const;
  250.  
  251.     void setEntityResolver( QXmlEntityResolver* handler );
  252.     QXmlEntityResolver* entityResolver() const;
  253.     void setDTDHandler( QXmlDTDHandler* handler );
  254.     QXmlDTDHandler* DTDHandler() const;
  255.     void setContentHandler( QXmlContentHandler* handler );
  256.     QXmlContentHandler* contentHandler() const;
  257.     void setErrorHandler( QXmlErrorHandler* handler );
  258.     QXmlErrorHandler* errorHandler() const;
  259.     void setLexicalHandler( QXmlLexicalHandler* handler );
  260.     QXmlLexicalHandler* lexicalHandler() const;
  261.     void setDeclHandler( QXmlDeclHandler* handler );
  262.     QXmlDeclHandler* declHandler() const;
  263.  
  264.     bool parse( const QXmlInputSource& input );
  265.  
  266. private:
  267.     // variables
  268.     QXmlContentHandler* contentHnd;
  269.     QXmlErrorHandler*   errorHnd;
  270.     QXmlDTDHandler*     dtdHnd;
  271.     QXmlEntityResolver* entityRes;
  272.     QXmlLexicalHandler* lexicalHnd;
  273.     QXmlDeclHandler*    declHnd;
  274.  
  275.     QChar c; // the character at reading position
  276.     int lineNr; // number of line
  277.     int columnNr; // position in line
  278.     int pos; // position in string
  279.  
  280.     int     namePos;
  281.     QChar   nameArray[256]; // only used for names
  282.     QString nameValue; // only used for names
  283.     int     refPos;
  284.     QChar   refArray[256]; // only used for references
  285.     QString refValue; // only used for references
  286.     int     stringPos;
  287.     QChar   stringArray[256]; // used for any other strings that are parsed
  288.     QString stringValue; // used for any other strings that are parsed
  289.  
  290.     QString xml;
  291.     int xmlLength;
  292.     QString xmlRef; // used for parsing of entity references
  293.  
  294.     QValueStack<QString> tags;
  295.  
  296.     QXmlSimpleReaderPrivate* d;
  297.  
  298.     static const QChar QEOF;
  299.  
  300.     // inlines
  301.     virtual bool is_S( const QChar& );
  302.     virtual bool is_Letter( const QChar& );
  303.     virtual bool is_NameBeginning( const QChar& );
  304.     virtual bool is_Digit( const QChar& );
  305.     virtual bool is_CombiningChar( const QChar& );
  306.     virtual bool is_Extender( const QChar& );
  307.     virtual bool is_NameChar( const QChar& );
  308.  
  309.     QString& string();
  310.     void stringClear();
  311.     void stringAddC();
  312.     void stringAddC(const QChar&);
  313.     QString& name();
  314.     void nameClear();
  315.     void nameAddC();
  316.     void nameAddC(const QChar&);
  317.     QString& ref();
  318.     void refClear();
  319.     void refAddC();
  320.     void refAddC(const QChar&);
  321.  
  322.     // used by parseReference() and parsePEReference()
  323.     enum EntityRecognitionContext { InContent, InAttributeValue, InEntityValue, InDTD };
  324.  
  325.     // private functions
  326.     void eat_ws();
  327.     void next_eat_ws();
  328.  
  329.     void next();
  330.     bool atEnd();
  331.  
  332.     void init( const QXmlInputSource& i );
  333.  
  334.     bool entityExist( const QString& ) const;
  335.  
  336.     bool parseProlog();
  337.     bool parseElement();
  338.     bool parseElementEmptyTag( bool &t, QString &uri, QString &lname );
  339.     bool parseElementETagBegin2();
  340.     bool parseElementAttribute( QString &prefix, QString &uri, QString &lname );
  341.     bool parseMisc();
  342.     bool parseContent();
  343.  
  344.     bool parsePI(bool xmldecl=FALSE);
  345.     bool parseDoctype();
  346.     bool parseComment();
  347.  
  348.     bool parseName( bool useRef=FALSE );
  349.     bool parseNmtoken();
  350.     bool parseAttribute();
  351.     bool parseReference( bool &charDataRead, EntityRecognitionContext context );
  352.     bool processReference( bool &charDataRead, EntityRecognitionContext context );
  353.  
  354.     bool parseExternalID( bool allowPublicID = FALSE );
  355.     bool parsePEReference( EntityRecognitionContext context );
  356.     bool parseMarkupdecl();
  357.     bool parseAttlistDecl();
  358.     bool parseAttType();
  359.     bool parseAttValue();
  360.     bool parseElementDecl();
  361.     bool parseNotationDecl();
  362.     bool parseChoiceSeq();
  363.     bool parseEntityDecl();
  364.     bool parseEntityValue();
  365.  
  366.     bool parseString( const QString& s );
  367.  
  368.     void reportParseError();
  369.  
  370.     friend class QXmlSimpleReaderPrivate;
  371.     friend class QXmlLocator;
  372. };
  373.  
  374. //
  375. // SAX Locator
  376. //
  377.  
  378. class QM_EXPORT QXmlLocator
  379. {
  380. public:
  381.     QXmlLocator( QXmlSimpleReader* parent )
  382.     { reader = parent; }
  383.     ~QXmlLocator()
  384.     { }
  385.  
  386.     int columnNumber();
  387.     int lineNumber();
  388. //    QString getPublicId()
  389. //    QString getSystemId()
  390.  
  391. private:
  392.     QXmlSimpleReader* reader;
  393.  
  394.     QXmlLocatorPrivate *d;
  395. };
  396.  
  397. //
  398. // SAX handler classes
  399. //
  400.  
  401. class QM_EXPORT QXmlContentHandler
  402. {
  403. public:
  404.     virtual void setDocumentLocator( QXmlLocator* locator ) = 0;
  405.     virtual bool startDocument() = 0;
  406.     virtual bool endDocument() = 0;
  407.     virtual bool startPrefixMapping( const QString& prefix, const QString& uri ) = 0;
  408.     virtual bool endPrefixMapping( const QString& prefix ) = 0;
  409.     virtual bool startElement( const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts ) = 0;
  410.     virtual bool endElement( const QString& namespaceURI, const QString& localName, const QString& qName ) = 0;
  411.     virtual bool characters( const QString& ch ) = 0;
  412.     virtual bool ignorableWhitespace( const QString& ch ) = 0;
  413.     virtual bool processingInstruction( const QString& target, const QString& data ) = 0;
  414.     virtual bool skippedEntity( const QString& name ) = 0;
  415.     virtual QString errorString() = 0;
  416. };
  417.  
  418. class QM_EXPORT QXmlErrorHandler
  419. {
  420. public:
  421.     virtual bool warning( const QXmlParseException& exception ) = 0;
  422.     virtual bool error( const QXmlParseException& exception ) = 0;
  423.     virtual bool fatalError( const QXmlParseException& exception ) = 0;
  424.     virtual QString errorString() = 0;
  425. };
  426.  
  427. class QM_EXPORT QXmlDTDHandler
  428. {
  429. public:
  430.     virtual bool notationDecl( const QString& name, const QString& publicId, const QString& systemId ) = 0;
  431.     virtual bool unparsedEntityDecl( const QString& name, const QString& publicId, const QString& systemId, const QString& notationName ) = 0;
  432.     virtual QString errorString() = 0;
  433. };
  434.  
  435. class QM_EXPORT QXmlEntityResolver
  436. {
  437. public:
  438.     virtual bool resolveEntity( const QString& publicId, const QString& systemId, QXmlInputSource* ret ) = 0;
  439.     virtual QString errorString() = 0;
  440. };
  441.  
  442. class QM_EXPORT QXmlLexicalHandler
  443. {
  444. public:
  445.     virtual bool startDTD( const QString& name, const QString& publicId, const QString& systemId ) = 0;
  446.     virtual bool endDTD() = 0;
  447. //    virtual bool startEntity( const QString& name ) = 0;
  448. //    virtual bool endEntity( const QString& name ) = 0;
  449.     virtual bool startCDATA() = 0;
  450.     virtual bool endCDATA() = 0;
  451.     virtual bool comment( const QString& ch ) = 0;
  452.     virtual QString errorString() = 0;
  453. };
  454.  
  455. class QM_EXPORT QXmlDeclHandler
  456. {
  457. public:
  458.     virtual bool attributeDecl( const QString& eName, const QString& aName, const QString& type, const QString& valueDefault, const QString& value ) = 0;
  459.     virtual bool internalEntityDecl( const QString& name, const QString& value ) = 0;
  460.     virtual bool externalEntityDecl( const QString& name, const QString& publicId, const QString& systemId ) = 0;
  461.     virtual QString errorString() = 0;
  462. };
  463.  
  464.  
  465. class QM_EXPORT QXmlDefaultHandler : public QXmlContentHandler, public QXmlErrorHandler, public QXmlDTDHandler, public QXmlEntityResolver, public QXmlLexicalHandler, public QXmlDeclHandler
  466. {
  467. public:
  468.     QXmlDefaultHandler() { }
  469.     virtual ~QXmlDefaultHandler() { }
  470.  
  471.     void setDocumentLocator( QXmlLocator* locator );
  472.     bool startDocument();
  473.     bool endDocument();
  474.     bool startPrefixMapping( const QString& prefix, const QString& uri );
  475.     bool endPrefixMapping( const QString& prefix );
  476.     bool startElement( const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts );
  477.     bool endElement( const QString& namespaceURI, const QString& localName, const QString& qName );
  478.     bool characters( const QString& ch );
  479.     bool ignorableWhitespace( const QString& ch );
  480.     bool processingInstruction( const QString& target, const QString& data );
  481.     bool skippedEntity( const QString& name );
  482.  
  483.     bool warning( const QXmlParseException& exception );
  484.     bool error( const QXmlParseException& exception );
  485.     bool fatalError( const QXmlParseException& exception );
  486.  
  487.     bool notationDecl( const QString& name, const QString& publicId, const QString& systemId );
  488.     bool unparsedEntityDecl( const QString& name, const QString& publicId, const QString& systemId, const QString& notationName );
  489.  
  490.     bool resolveEntity( const QString& publicId, const QString& systemId, QXmlInputSource* ret );
  491.  
  492.     bool startDTD( const QString& name, const QString& publicId, const QString& systemId );
  493.     bool endDTD();
  494. //    bool startEntity( const QString& name );
  495. //    bool endEntity( const QString& name );
  496.     bool startCDATA();
  497.     bool endCDATA();
  498.     bool comment( const QString& ch );
  499.  
  500.     bool attributeDecl( const QString& eName, const QString& aName, const QString& type, const QString& valueDefault, const QString& value );
  501.     bool internalEntityDecl( const QString& name, const QString& value );
  502.     bool externalEntityDecl( const QString& name, const QString& publicId, const QString& systemId );
  503.  
  504.     QString errorString();
  505.  
  506. private:
  507.     QXmlDefaultHandlerPrivate *d;
  508. };
  509.  
  510. #ifdef _WS_QWS_
  511. #ifdef QT_XML_CPP
  512. #define inline
  513. #else
  514. #define QT_NO_XML_INLINE
  515. #endif
  516. #endif
  517.  
  518. #ifndef QT_NO_XML_INLINE
  519. //
  520. // inlines
  521. //
  522.  
  523. inline bool QXmlSimpleReader::is_S(const QChar& ch)
  524. { return ch==' ' || ch=='\t' || ch=='\n' || ch=='\r'; }
  525.  
  526. inline bool QXmlSimpleReader::is_Letter( const QChar& ch )
  527. { return ch.isLetter(); }
  528.  
  529. inline bool QXmlSimpleReader::is_NameBeginning( const QChar& ch )
  530. { return ch=='_' || ch==':' || ch.isLetter(); }
  531.  
  532. inline bool QXmlSimpleReader::is_Digit( const QChar& ch )
  533. { return ch.isDigit(); }
  534.  
  535. inline bool QXmlSimpleReader::is_CombiningChar( const QChar& )
  536. { return FALSE; }
  537.  
  538. inline bool QXmlSimpleReader::is_Extender( const QChar& )
  539. { return FALSE; }
  540.  
  541. inline bool QXmlSimpleReader::is_NameChar( const QChar& ch )
  542. {
  543.     return ch=='.' || ch=='-' || ch=='_' || ch==':' ||
  544.     is_Letter(ch) || is_Digit(ch) ||
  545.     is_CombiningChar(ch) || is_Extender(ch);
  546. }
  547.  
  548. inline void QXmlSimpleReader::next()
  549. {
  550.     if ( !xmlRef.isEmpty() ) {
  551.     c = xmlRef[0];
  552.     xmlRef.remove( 0, 1 );
  553.     } else {
  554.     if ( c=='\n' || c=='\r' ) {
  555.         lineNr++;
  556.         columnNr = -1;
  557.     }
  558.     if ( pos >= xmlLength ) {
  559.         c = QEOF;
  560.     } else {
  561.         c = xml[pos];
  562.         columnNr++;
  563.         pos++;
  564.     }
  565.     }
  566. }
  567.  
  568. inline bool QXmlSimpleReader::atEnd()
  569. { return c == QEOF; }
  570.  
  571. inline void QXmlSimpleReader::eat_ws()
  572. { while ( !atEnd() && is_S(c) ) next(); }
  573.  
  574. inline void QXmlSimpleReader::next_eat_ws()
  575. { next(); eat_ws(); }
  576.  
  577.  
  578. // use buffers instead of QString::operator+= when single characters are read
  579. inline QString& QXmlSimpleReader::string()
  580. {
  581.     stringValue += QString( stringArray, stringPos );
  582.     stringPos = 0;
  583.     return stringValue;
  584. }
  585. inline QString& QXmlSimpleReader::name()
  586. {
  587.     nameValue += QString( nameArray, namePos );
  588.     namePos = 0;
  589.     return nameValue;
  590. }
  591. inline QString& QXmlSimpleReader::ref()
  592. {
  593.     refValue += QString( refArray, refPos );
  594.     refPos = 0;
  595.     return refValue;
  596. }
  597.  
  598. inline void QXmlSimpleReader::stringClear()
  599. { stringValue = ""; stringPos = 0; }
  600. inline void QXmlSimpleReader::nameClear()
  601. { nameValue = ""; namePos = 0; }
  602. inline void QXmlSimpleReader::refClear()
  603. { refValue = ""; refPos = 0; }
  604.  
  605. inline void QXmlSimpleReader::stringAddC()
  606. {
  607.     if ( stringPos >= 256 ) {
  608.     stringValue += QString( stringArray, stringPos );
  609.     stringPos = 0;
  610.     }
  611.     stringArray[stringPos++] = c;
  612. }
  613. inline void QXmlSimpleReader::nameAddC()
  614. {
  615.     if ( namePos >= 256 ) {
  616.     nameValue += QString( nameArray, namePos );
  617.     namePos = 0;
  618.     }
  619.     nameArray[namePos++] = c;
  620. }
  621. inline void QXmlSimpleReader::refAddC()
  622. {
  623.     if ( refPos >= 256 ) {
  624.     refValue += QString( refArray, refPos );
  625.     refPos = 0;
  626.     }
  627.     refArray[refPos++] = c;
  628. }
  629.  
  630. inline void QXmlSimpleReader::stringAddC(const QChar& ch)
  631. {
  632.     if ( stringPos >= 256 ) {
  633.     stringValue += QString( stringArray, stringPos );
  634.     stringPos = 0;
  635.     }
  636.     stringArray[stringPos++] = ch;
  637. }
  638. inline void QXmlSimpleReader::nameAddC(const QChar& ch)
  639. {
  640.     if ( namePos >= 256 ) {
  641.     nameValue += QString( nameArray, namePos );
  642.     namePos = 0;
  643.     }
  644.     nameArray[namePos++] = ch;
  645. }
  646. inline void QXmlSimpleReader::refAddC(const QChar& ch)
  647. {
  648.     if ( refPos >= 256 ) {
  649.     refValue += QString( refArray, refPos );
  650.     refPos = 0;
  651.     }
  652.     refArray[refPos++] = ch;
  653. }
  654. #endif
  655.  
  656. #ifdef _WS_QWS_
  657. #ifdef QT_XML_CPP
  658. #undef inline
  659. #endif
  660. #endif
  661.  
  662. #endif //QT_NO_XML
  663.  
  664. #endif
  665.